home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / sio.1.5.6 / Config / sunos4.1-config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-09  |  2.7 KB  |  98 lines

  1. /*
  2.  * (c) Copyright 1992 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7.  
  8. /*
  9.  * $Id: sunos4.1-config.h,v 7.4 1992/06/22 20:34:42 panos Exp $
  10.  */
  11.  
  12. /*
  13.  * NOTE: ALL BINARY FLAGS MUST BE EITHER define'd OR undef'ed.
  14.  *           DO NOT SKIP FLAGS; undef THEM
  15.  */
  16.  
  17.  
  18. /************************ MEMORY MAPPING ****************************/
  19.  
  20. /*
  21.  * Either define or undef MEMORY_MAP
  22.  * If you define it, you must also define the memory mapping interface
  23.  * functions: SIO_MMAP, SIO_MUNMAP, SIO_MNEED
  24.  * SIO_MNEED is not necessary; if your OS does not support it
  25.  * define it to nothing.
  26.  */ 
  27. #define MEMORY_MAP
  28. #include <sys/types.h>
  29. #include <sys/mman.h>
  30.  
  31. #define SIO_MMAP( addr, len, fd, off )                                                \
  32.             mmap( addr, len, PROT_READ,                                                \
  33.                 ( addr == 0 ) ? MAP_PRIVATE : MAP_PRIVATE + MAP_FIXED,        \
  34.                     fd, off )
  35. #define SIO_MUNMAP( addr, len )    munmap( addr, len )
  36. #define SIO_MNEED( addr, len )        (void) madvise( addr, len, MADV_WILLNEED ) 
  37.  
  38.  
  39. /************************ FINALIZATION CODE ****************************/
  40.  
  41. /*
  42.  * Either define or undef HAS_FINALIZATION
  43.  * If you define it, you must define the macros SIO_FINALIZE 
  44.  * and SIO_DEFINE_FIN
  45.  * SIO_FINALIZE has a function as an argument and its value
  46.  * is an expression whose value is TRUE if the finalization function
  47.  * was successfully installed
  48.  * SIO_DEFINE_FIN has a function as an argument and created an
  49.  * appropriate function definition.
  50.  */
  51. #define HAS_FINALIZATION_FUNCTION
  52. #define SIO_FINALIZE( func )            ( on_exit( func, (caddr_t) 0 ) == 0 )
  53. #define SIO_DEFINE_FIN( func )        static void func ( exit_status, arg )     \
  54.                                                         int exit_status ;                        \
  55.                                                         caddr_t arg ;
  56.  
  57.  
  58. /************************ GENERAL CONSTANTS ****************************/
  59.  
  60. /*
  61.  * Define at most 1 of the following two flags
  62.  */
  63. #define HAS_MEMOPS
  64. #undef HAS_BCOPY
  65.  
  66. /*
  67.  * Define HAS_ISATTY if the function isatty( fd ) exists in the C library
  68.  */
  69. #define HAS_ISATTY
  70.  
  71. /*
  72.  * N_SIO_DESCRIPTORS is the maximum number of file descriptors
  73.  * supported by the OS
  74.  */
  75. #include <sys/param.h>
  76. #define N_SIO_DESCRIPTORS            NOFILE
  77.  
  78. /************************ SPRINT CONSTANTS ****************************/
  79.  
  80. /*
  81.  * SMALLEST_INT:     smallest integer the machine can represent
  82.  * S_SMALLEST_INT:   the smallest integer as a string
  83.  * S_SMALLEST_INT_LEN: length of string containing smallest integer
  84.  *
  85.  * These constants depend on the word size of the CPU and the
  86.  * type of arithmetic (1's or 2's complement).
  87.  */
  88.  
  89. #define SMALLEST_INT                (-2147483648)
  90. #define S_SMALLEST_INT              "2147483648"      /* note: no '-' sign */
  91. #define S_SMALLEST_INT_LEN          10
  92.  
  93. /*
  94.  * Define LONG_IS_BIGGER is sizeof( long ) != sizeof( int )
  95.  */
  96. #undef LONG_IS_BIGGER
  97.  
  98.